package com.czk.utils;

import com.alibaba.fastjson.JSON;
import com.czk.domain.MsgAgreement;

/**
 * 消息协议工具类
 *
 * @Author:ChenZhangKun
 * @Date: 2021/4/29 11:06
 */
public class MsgUtil {
    public static MsgAgreement buildMsg(String channelId, String content) {
        return new MsgAgreement(channelId, content);
    }

    public static MsgAgreement json2Obj(String objJsonStr) {
        return JSON.parseObject(objJsonStr, MsgAgreement.class);
    }

    public static String obj2Json(MsgAgreement msgAgreement) {
        return JSON.toJSONString(msgAgreement) + "\r\n";
    }

}
